package org.tea.inventory.admin;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@SpringBootApplication(scanBasePackages = {"org.tea.inventory.admin", "org.tea.inventory.db",  "org.tea.inventory", "org.tea.inventory.log"})
@MapperScan(basePackages = {"org.tea.inventory.**.dao"})
@EnableRabbit
@EnableScheduling
@EnableConfigurationProperties
public class Application {
    @Bean
    @Primary
    public AsyncTaskExecutor taskExecutor() {
        return new ThreadPoolTaskExecutor();
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        System.out.println("------------------启动成功--------------------");
    }

}